﻿<?php //Seyret Component v.0.3//
/**
* @package Seyret
* @version 0.3
* @copyright Copyright (C) 2008 Mustafa DINDAR. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Seyret Video Component is a free software.
* See seyrettos.html for license notices and details.
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

$document = & JFactory::getDocument();
$csslink=JURI :: root()."components/com_seyret/themes/default/style/default.seyret.css";
$document->addStyleSheet($csslink);

$jslink=JURI :: root()."components/com_seyret/includes/js/jquery-1.3.2.min.js";
$document->addScript($jslink);



$session =& JFactory::getSession();
$seyretmessage=$session->get('seyret.message');
$seyretmessagetype=$session->get('seyret.messagetype');
$session->clear('seyret.message');
$session->clear('seyret.messagetype');


$user =& JFactory::getUser();


$checkmembership = $this->checkmembership;

?>

<style>

body {
background-color: white;
}
</style>


<div class="<?php echo $seyretmessagetype;?>">
<?php echo $seyretmessage;?>
</div>




<div id="emailForm" >
	<div style="padding:10px;">
	
<?php

//---------------------------  FORM -------------------START
if ($this->registry->getValue('permission.access.canrequestjoinchannels')=="1"){
		
		
		if ($checkmembership=="alreadymember") {
			echo "<div class=''>". JText::_('You are already member of this channel') . "</div>";
			return;
		} else if ($checkmembership=="waitingapproval") {
			echo "<div class=''>". JText::_('Your request is waiting for approval') . "</div>";
			return;
		} else if ($checkmembership=="rejected") {
			echo "<div class=''>". JText::_('Your request is rejected') . "</div>";
			return;
		} if ($checkmembership=="canapply") {
		
		

?>

		<div class=""><?php echo JText::_('Enter extra message to join channel');?></div>

		<form id="emailtofriendform" action="index2.php?option=com_seyret&view=channel&task=joinchannelsubmit" method="post" >

		<div class="emailtofriendlabel"><?php echo JText::_('Channel Title');?></div>
		<div class="emailtofriendinput"><input type="text" name="channeltitle" id="channeltitle" class="seyretinputbox etfinputbox" value="<?php echo $this->channeltitle;?>" readonly="readonly" ></div>
		<div style="clear:both;"></div>

		
		<div class="emailtofriendlabel"><?php echo JText::_('Your Username');?></div>
		<div class="emailtofriendinput"><input type="text" name="username" id="username" class="seyretinputbox etfinputbox" value="<?php echo $user->username;?>" readonly="readonly" ></div>
		<div style="clear:both;"></div>		
		
		
		<div class="emailtofriendlabel"><?php echo JText::_('Message');?></div>
		<div class="emailtofriendinput"><input type="text" name="joinmessage" id="joinmessage" class="seyretinputbox etfinputbox" value=""></div>
		

		<input type="hidden" name="channelid" value="<?php echo $this->channelid; ?>" />
		
		
		<div style="text-align:center; padding:5px;"><input type="submit" name="button" id="submitter" value="<?php echo JText::_('Send');?>"/></div>
		
		
		
		</form>

<?php
		//--------------------------- FORM -------------------END

		}
} else {
?>

<div class="emaildonthaverights"><?php echo JText::_("You dont have rights to join channels");?></div>
<div  class="emaildonthaverights"><img src="<?php echo JURI::root()."components/com_seyret/themes/default/images/notallowed.png"?>" /></div>


<?php
}

?>	
		
	</div>
</div>